A robot which includes a robot body having a multijoint arm unit including a plurality of link members and a hand unit disposed in an end of the arm unit and which grasps an object serving as a first workpiece using the hand unit and attaches the grasped object to another object serving as a second workpiece has been generally used.
Furthermore, various techniques of measuring a position using a camera including a stereo method have been used, and a 3D position of a feature point of an object included in an image captured by a camera can be measured by such a technique. Furthermore, a position and orientation of an object can be measured by measuring a plurality of feature points of an object. Moreover, various techniques of measuring a position using a phototransmitter and a photoreceiver in combination instead of a camera have been used.
In general, a mechanism configured such that a camera which is used to capture an image of a grasped object and another object so as to measure positions and orientations of the grasped object and the other object is fixed to a camera-mounting stage disposed over an operation position in which the grasped object is attached to the other object by the robot body has been used (refer to PTL 1). Furthermore, a camera fixed to the hand unit of the robot body has been used (refer to PTL 2).
Here, if the hand unit grasps different positions of the object at different times, it is difficult to accurately attach the grasped object to the other object. Therefore, results of measurements of positions and orientations of the grasped object and the other object should be fed back so that operation instructions for specifying a trajectory of the robot body are generated.
Here, the positions and orientations of the grasped object and the other object are calculated by a camera on the basis of a camera coordinate system whereas the operation instructions generated to operate the robot body in a predetermined trajectory are based on a robot coordinate system. Therefore, a coordinate transformation matrix used to transfer coordinate data representing the measured positions and orientations in the camera coordinate system into coordinate data in the robot coordinate system should be obtained.
Accordingly, in general, since it is estimated that the position and orientation of the camera fixed to the camera-mounting stage in the camera coordinate system is constant relative to the robot coordinate system, a coordinate transformation matrix including preset constant values has been used.
Furthermore, when the camera is fixed to the hand unit, the position and orientation in the camera coordinate system is changed relative to the robot coordinate system in response to an operation of the robot body. Accordingly, the position and orientation in the camera coordinate system relative to the robot coordinate system can be estimated in accordance with a position and orientation of an end of a hand obtained in accordance with the direct kinematics using joint angles of the robot body. The coordinate transformation matrix is generally calculated in accordance with the relationship between the camera coordinate system and the robot coordinate system estimated as described above.